package com.jbm.jbmsupplier.activity.searchmanage.view

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.View
import com.handmark.pulltorefresh.library.PullToRefreshListView
import com.jbm.jbmsupplier.R
import com.jbm.jbmsupplier.activity.searchmanage.presenter.Search_Pre
import com.jbm.jbmsupplier.activity.searchmanage.utlis.PermUtlisClass
import com.jbm.jbmsupplier.utlis.ExitActivity
import kotlinx.android.synthetic.main.activity_search_manage.*
import kotlinx.android.synthetic.main.lz_titlehurdle.*

class SearchManage : AppCompatActivity() , View.OnClickListener,SearchManageInt {
    override fun getpull(): PullToRefreshListView {
        return pull_refresh_list_search
    }

    override fun onClick(v: View?) {
        when(v?.id){
   R.id.teleft ->{
       finish()
   }

        }
    }
    var permutlis:PermUtlisClass?=null
    var search: Search_Pre?=null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        ExitActivity.getInstance().addActivity(this)
        setContentView(R.layout.activity_search_manage)
       teleft.setOnClickListener(this)
        search= Search_Pre(this,this);
        search?.getAllMan()
      tetitle.text="权限管理"
        pullUpRefresh()
    }

    private fun pullUpRefresh() {
//  pull_refresh_list_search.setOnLastItemVisibleListener(PullToRefreshBase.OnLastItemVisibleListener {
//            //预加载
//      pull_refresh_list_search.onRefreshComplete()
//        })
//      pull_refresh_list_search.setOnRefreshListener(object : PullToRefreshBase.OnRefreshListener2<ListView> {
//            override fun onPullDownToRefresh(refreshView: PullToRefreshBase<ListView>) {//下拉
//                pull_refresh_list_search.onRefreshComplete()
//            }
//
//            override fun onPullUpToRefresh(refreshView: PullToRefreshBase<ListView>) {//上拉
//                pull_refresh_list_search.onRefreshComplete()
//            }
//
//        })
    }

}
